// SPDX-License-Identifier: GPL-2.0
/*
 * CRASH
 *
 * (C) 2024.05.01 BuddyZhang1 <buddy.zhang@aliyun.com>
 */

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mm.h>

static int __init BiscuitOS_init(void)
{
	struct page *page;

	/* ALLOC MEMORY */
	page = alloc_page(GFP_KERNEL);
	if (!page)
		return -ENOMEM;

	printk("PFN %#lx VA %#lx\n",
			page_to_pfn(page), (unsigned long)page_to_virt(page));

	panic("BiscuitOS TRIGGER KDUMP\n");

	/* IGNORE RECLAIM */
	;

	return 0;
}

static void __exit BiscuitOS_exit(void) { }

module_init(BiscuitOS_init);
module_exit(BiscuitOS_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("BiscuitOS <buddy.zhang@aliyun.com>");
MODULE_DESCRIPTION("Linux Dream Motion on BiscuitOS");
